package com.wenlin.userservice.controller;

import com.wenlin.userservice.domain.User;
import com.wenlin.userservice.response.Message;
import com.wenlin.userservice.service.UserService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/***
 *  Created with IntelliJ IDEA.
 *  User:  wenlin
 *  Date:  2017/11/23
 *  Time:  16:03
 *  Description:
 **/
@RestController
@RequestMapping("/user/base")
public class UserController {
    static Logger logger = LoggerFactory.getLogger(UserController.class);
    @Autowired
    private UserService userService;

    @GetMapping("info")
    public Message<User> getUser(@RequestParam("id") Integer id){
        logger.info(id+"");
        return userService.selectByPrimaryId(id);
    }

}
